﻿#include "FITKAbaMaterialDensity.h"


Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialBehaviorType Interface::FITKAbaMaterialDensity::getMaterialBehaviorType()
{
    return Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialBehaviorType::Density;
}

double Interface::FITKAbaMaterialDensity::getMassDensity(int index) const
{
    if (index < m_massDensities.size())
        return m_massDensities.at(index);
    return 0.0;
}

void Interface::FITKAbaMaterialDensity::setMassDensity(double massDensity, int index)
{
    if (index < m_massDensities.size())
        m_massDensities[index] = massDensity;
}

bool Interface::FITKAbaMaterialDensity::getUseTemperatureDependentData() const
{
    return m_useTemperatureDependentData;
}

void Interface::FITKAbaMaterialDensity::setUseTemperatureDependentData(bool stat)
{
    m_useTemperatureDependentData = stat;
    if (!m_useTemperatureDependentData)
    {
        m_massDensities.resize(1);
        m_temperatures.resize(1);
    }
}

double Interface::FITKAbaMaterialDensity::getTemperature(int index) const
{
    if (index < m_temperatures.size())
        return m_temperatures.at(index);
    return 0.0;
}

void Interface::FITKAbaMaterialDensity::setTemperature(double temperature, int index)
{
    if (index < m_temperatures.size())
        m_temperatures[index] = temperature;
}

int Interface::FITKAbaMaterialDensity::getNumberOfRows() const
{
    return m_temperatures.size();
}

void Interface::FITKAbaMaterialDensity::setNumberOfRows(int rows)
{
    if (!m_useTemperatureDependentData)
        return;
    m_massDensities.resize(rows);
    m_temperatures.resize(rows);
}

